package com.learn.springbootcache.service;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;

/**
 * @author jiaomingyu5778@gmail.com
 * @date 2019/10/25 0:17
 */
@Service
public class ScheduedService {

    private static final Logger logger = LoggerFactory.getLogger(ScheduedService.class);

    /**
     * 定时任务注解，给方法加
     * minute, hour, day of month, month and day of week
     * {@code "0 * * * * MON-FRI"}
     */
    @Scheduled(cron = "0,1,2,3,4 * * * * MON-FRI")
    public void hello(){
        logger.info("我是定时任务测试");
    }
}
